//
//  FHComposeButton.swift
//  WeiBo
//
//  Created by qfh on 16/7/17.
//  Copyright © 2016年 qiufuhe. All rights reserved.
//

import UIKit

class FHComposeButton: UIButton {
    
    
    var composeModel: FHCompose?
    

    
    //  重写highlighted属性
    override var highlighted: Bool {
        get {
            return false
        }
        set {
            
        }
    }
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }
    


    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI() {
    
        
        titleLabel?.font = UIFont.systemFontOfSize(15)
        
        titleLabel?.textAlignment = .Center
        
        setTitleColor(UIColor.grayColor(), forState: .Normal)
        
//        self.userInteractionEnabled = false
    
    }
    
    
    
    
    
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        
        imageView?.width = width
        
        imageView?.height = width
        
        imageView?.x = 0
        
        imageView?.y = 0
        
        titleLabel?.x = 0
        
        titleLabel?.y = width
        
        titleLabel?.width = width
        
        titleLabel?.height = height - width
        
        
        
        
        
    }
    
    
    
    
    
}
